#include <stdio.h>
#include <stdlib.h>
#include <time.h>
struct CARD{
	int num;
	int name;
};
struct CARD Player[4][13];
char *Face[4]={"红心","方块","梅花","黑桃"};
char *Point[13]={"1","2","3","4","5","6","7","8","9","10","J","Q","K"};
void DeliverCard(char *str)
{
	int k=0,q=0,tmp=0;
	for(k=0;k<52;k++)
	{
		while(1)
		{
			tmp=rand()%52;
			for(q=0;q<k;q++)
			{
				if(str[q]==tmp)
					break;
			}
			if(q==k)
			{
				str[k]=tmp;
				break;
			}
		}
	}
}
void DisplayCard()
{
	int i=0,j=0;
	printf("Player1\tPlayer2\tPlayer3\tPlayer4\n");
	for(j=0;j<13;j++)
	{
		for(i=0;i<4;i++)
		{
			printf("%s %s\t",Face[Player[i][j].num],Point[Player[i][j].name]);
		}
		printf("\n");
	}
}

int main()
{
	char tmp[52];
	int i=0,j=0,k=0;
	srand((unsigned)time(NULL));
	DeliverCard(tmp);
	for(k=0;k<52;k++)
	{
		i=k%4;
		j=k/4;
		Player[i][j].num=tmp[k]%4;
		Player[i][j].name=tmp[k]/4;
	}
	DisplayCard();
	return 0;
}
